# -*- coding: utf-8 -*-
__author__ = 'ggcall'
from PAM30 import PAMIE
from pyquery import PyQuery as pq

# 测试环境：
# win7 64位
# ie9
# python 2.7.2
# pamie 3.0

ie=PAMIE()
ie.navigate("baidu.com")

# ie9修改文档模式为ie8标准才可以，默认是ie9标准

# ie.setTextBox('q','python')
# ie.buttonClick('btnK')
#html=ie.getPageText()
html=ie.outerHTML()
#ie.executeJavaScript(open(r'lib\jquery-1.7.min.js','r').read())
# a='$(function() {'+\
    # 'alert($(".gbts").text());'+\
    # '});'
#a=open(r'pamie3_test.js','r').read()
#ie.executeJavaScript(a)
#print b

fp = open('pamie3.html','w')
#print html.encode('utf-8')
fp.write(html.encode('utf-8'))
fp.close()
d=pq(filename='pamie3.html')
print d('script').attr.src
ie.quit()